{% extends 'WebQuant/base.html' %}
{% block title %}云交易{% endblock %}
{% block content %}
<div class="wrap">
	<div class="main">
		<div class="wrap_head">
			<div class="head_left">
				<ul>
					<li class="on" id="stock"><a href="">模拟交易</a></li>
				</ul>
			</div>
			<div class="head_right">
				<a href="/deal/new">创建模拟交易</a>
			</div>
		</div>
		<div class="target">
			<div class="bar_list">
				<div style="border:none" onclick="show_all()" id = "display_all" class="on">全部</div>
				<a href="javascript:void(0);" onclick="show_run()"><div id = "display_run">运行中</div></a>
				<a href="javascript:void(0);" onclick="show_stop()"><div id = "display_stop">已终止</div></a>
				{% if deal_list %}
				<a href="javascript:void(0);" class="delete"></a>
				{% endif %}
			</div>
			{% if deal_list %}
			<div class="hascont">
				<div class="list">
					<div class="listborder">
						<div class="listhead">
							<span class="col1"><input class="setall" type="checkbox"  value="全选/全不选" /></span><span class="col2">名称</span><span class="col3">状态</span>
							<span class="col4">开始日期</span><span class="col5">结束日期</span><span class="col6">累计收益率</span><span class="col7">最大回撤</span>
						</div>
						<div class="listborder_bottom">
							<div class="lcinfo">
								<ul class="query" id = "ul_deal_list" >
									{% for deal_info in deal_list %}
										<li deal="true" status={{deal_info.status}} deal_id={{deal_info.deal_id}}>
											<span class="col1"><input name="Fruit" type="checkbox" value="" /></span>
											<a href="#"><span class="col2" onclick="on_goto_deal(this)" deal_id={{deal_info.deal_id}} title='{{deal_info.deal_name}}'>{{deal_info.deal_name}}</span></a>
											<span class="col3">{{deal_info.status}}</span>
											<span class="col4">{{deal_info.begin_date}}</span>
											<span class="col5">{{deal_info.end_date}}</span>
											<span class="col6">{{deal_info.return}}</span>
											<span class="col7">{{deal_info.max_drop_down}}</span>
										</li>
									{% endfor %}
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
			{% else %}
			<div class="nocont">
				<p>没有正在运行的模拟交易</p>
				<a href="/deal/new">去创建</a>
			</div>
			{% endif %}
		 </div>

	</div>
	<div class="page">
	</div>
</div><!-- 内容 -->
<div class="mask"></div>
<div class="pannel">
	<button class="close"></button>
	<h2>新建策略</h2>
	<form action="#">
		<span>策略名称</span>
		<input type="text" class="ti">
		<p><input type="checkbox" name="category" value="股票" style="margin-left:0" checked="checked" />股票
		<input type="checkbox" name="category" value="期货" />期货
		<input type="checkbox" name="category" value="现货" disabled="true"/>现货</p>
		<input type="submit" value="确定">
	</form>
</div>
<div class="pannel1 yjy">
	<p><span class="tip">确定要删除该模拟交易吗？</span></p>
	<input type="button" value="取消" class="no">
	<input type="button" value="确定" class="yes" onclick="delete_deal()">
</div>
<script src="/static/WebQuant/js/jq.js"></script>
<script src="/static/WebQuant/js/csrf.js"></script>
<script src="/static/WebQuant/js/base.js"></script>
<script src="/static/WebQuant/js/mustache.min.js"></script>
<script src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="/static/WebQuant/js/deal.js"></script>
{% endblock %}
{% block bottom %}
{% include 'WebQuant/bottom.html' %}
<script>
	var isLog = {{log}};
	if (isLog)
	{
		$(".l_case2").css("display","block");
		$(".l_case1").css("display","none");
	}
	else
	{
		$(".l_case2").css("display","none");
		$(".l_case1").css("display","block");
        showLogin();
	}
</script>
{% endblock %}